﻿@model MvcMasterPage.Entity.Review
@{
    Layout = null;
}
@using Commons.Entity;
<style>
    li {
        list-style-type: none;
    }
    * {
        padding: 0px;
    }
</style>
<script src="../../Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function submitForm() {
        //异步提交
        $.ajax({
            type: "Post",
            url: "/common/review",
            data: $("form").serialize(),
            success: function (data) {
                if (data.res) {
                    $(".boxy-wrapper", window.parent.document).hide();
                    location.href = location.href;
                } else {
                    alert(data.info);
                }
            }
        });

    }
</script>
@using (Html.BeginForm("Review", "Common"))
{
    <fieldset>
        <legend>
            @(((MvcMasterPage.Entity.ObjType)Model.ObjType).GetDescription())评论
            @Html.ValidationSummary(true)
            @Html.HiddenFor(i => i.ObjID)
            @Html.HiddenFor(i => i.ObjType)
        </legend>
        <ul>
            <li></li>
            <li>内容：@Html.TextAreaFor(i => i.Info)</li>
            <li>@Html.ValidationMessageFor(i => i.Info)</li>
            <li>
                <div id="ValidateCodeSpan">
                    请输入验证码：@Html.TextBox("VCode")
                    <img id="valiCode" style="cursor: pointer;" src="/Common/GetValidateCode" alt="看不清？请点我" />
                    <script type="text/javascript">
                        $("#valiCode").bind("click", function () {
                            this.src = "/Common/GetValidateCode?time=" + (new Date()).getTime();
                        });
                    </script>
                </div>
            </li>
        </ul>
    </fieldset>
    <input type="button" onclick="submitForm()" value="提交" />
}